<template>
    <div>
        <!--      头部查询部分-->
        <el-row :gutter="4">
            <el-col :span="4">
                <el-autocomplete
                        class="inline-input"
                        prefix-icon="fa fa-search"
                        v-model="keyword.teacherName"
                        :fetch-suggestions="querySearch"
                        placeholder="教师姓名"
                        :trigger-on-focus="false"
                        @keyup.enter.native="initTeacherBase"
                        v-permission="'teacher:base:list'"
                        clearable
                ></el-autocomplete>
            </el-col>
            <el-col :span="4">
                <el-input v-model.trim="keyword.teacherCollegeId" prefix-icon="fa fa-search" placeholder="教工号"
                          v-permission="'teacher:base:list'"
                          @keyup.enter.native="initTeacherBase"></el-input>
            </el-col>
            <el-col :span="2">
                <el-button type="primary" icon="fa fa-search" @click="initTeacherBase"
                           v-permission="'teacher:base:list'"> 搜 索
                </el-button>
            </el-col>

            <el-col :span="2" :offset="2">
                <el-popover
                        placement="bottom"
                        width="800"
                        v-model="visible"
                        trigger="click">
                    <el-form ref="keyword" :model="keyword" label-width="100px" label-position="left">
                        <h3 align="center">高 级 搜 索</h3>
                        <el-row :gutter="30">
                            <el-col :span="8">
                                <el-form-item label="教师姓名:" prop="teacherName">
                                    <el-input v-model="keyword.teacherName" prefix-icon="el-icon-user"
                                              placeholder="教师姓名"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="教工号:" prop="teacherCollegeId">
                                    <el-input v-model="keyword.teacherCollegeId" prefix-icon="el-icon-user-solid"
                                              placeholder="教工号"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="学位:" prop="teacherDegree">
                                    <el-input v-model="keyword.teacherDegree" placeholder="学位"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="学历:" prop="teacherDiplomas">
                                    <el-input v-model="keyword.teacherDiplomas" placeholder="学历"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="部门:" prop="teacherDepartment">
                                    <el-input v-model="keyword.teacherDepartment" placeholder="部门"></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item label="毕业学校:" prop="teacherGraduateCollege">
                                    <el-input v-model="keyword.teacherGraduateCollege" placeholder="毕业学校"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="毕业专业:" prop="teacherMajor">
                                    <el-input v-model="keyword.teacherMajor" placeholder="毕业专业"></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item label="毕业时间:" prop="teacherGraduateDate">
                                    <el-date-picker
                                            v-model="keyword.teacherGraduateDate"
                                            type="year"
                                            format="yyyy"
                                            value-format="yyyy"
                                            placeholder="毕业时间">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="性别:" prop="teacherGender">
                                    <el-select v-model="keyword.teacherGender" placeholder="性别">
                                        <el-option
                                                v-for="item in teacherGenderList"
                                                :key="item"
                                                :label="item"
                                                :value="item">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item label="是否在编:" prop="teacherSituation">
                                    <el-select v-model="keyword.teacherSituation" placeholder="是否在编">
                                        <el-option
                                                v-for="item in teacher_situationList"
                                                :key="item"
                                                :label="item"
                                                :value="item">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item label="是否在职:" prop="teacherRetired">
                                    <el-select v-model="keyword.teacherRetired" placeholder="是否在职">
                                        <el-option
                                                v-for="item in teacher_retired"
                                                :key="item"
                                                :label="item"
                                                :value="item">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <div style="display: flex;justify-content: center;">
                            <el-form-item>
                                <el-button type="primary" icon="fa fa-search" @click="initTeacherBase"> 搜 索</el-button>
                                <el-button icon="fa fa-refresh" @click="$refs.keyword.resetFields()" size="small"> 清 空
                                </el-button>
                            </el-form-item>
                        </div>

                    </el-form>
                    <el-button slot="reference" type="primary" icon="fa fa-angle-double-down"
                               v-permission="'student:base:list'"> 高 级 搜 索
                    </el-button>
                </el-popover>
            </el-col>

            <el-col :span="2" style="margin-left: 20px">
                <el-button type="primary" icon="fa fa-plus" @click="handleAdd"
                           v-permission="'teacher:base:add'"> 添 加 信 息
                </el-button>
            </el-col>
            <el-col :span="2" style="margin-left: 20px">
                <el-button type="danger" icon="fa fa-trash" @click="handleMultipleDelete"
                           v-permission="'teacher:base:delete'"> 删
                    除 多 个
                </el-button>
            </el-col>
            <el-col :span="2" style="margin-left: 20px">
                <el-button type="success" icon="fa fa-download" @click="exportExcel" v-permission="'teacher:base:list'">
                    导 出 Excel
                </el-button>
            </el-col>
            <el-col :span="1" style="margin-left: 20px;">
                <el-button type="warning" icon="fa fa-refresh"
                           v-permission="'teacher:base:list'"
                           @click="refresh">
                </el-button>
            </el-col>
        </el-row>
        <!--      表格区域-->
        <el-row>
            <el-col :span="24">
                <el-table width="100%" border :data="page.row" @selection-change="handleSelectionChange"
                          @row-dblclick="dbClick"
                >
                    <el-table-column type="selection" width="50" align="center"></el-table-column>
                    <!--      详情信息              -->
                    <el-table-column prop="teacherName" label="姓名" align="center" width="160"
                                     fixed="left"></el-table-column>
                    <el-table-column label="详情" align="center">
                        <template slot-scope="scope">
                            <el-button @click="viewDetails(scope.row)" type="text">查看详情</el-button>
                        </template>
                    </el-table-column>
                    <el-table-column prop="teacherBirthday" label="生日" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherCollegeId" label="教工号" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherDegree" label="学位" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherDepartment" label="部门" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherDiplomas" label="学历" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherGender" label="性别" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherGraduateCollege" label="毕业学校" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherGraduateDate" label="毕业时间" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherHireDate" label="职称起聘时间" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherIdentityId" label="身份证" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherPartyDate" label="入党时间" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherInDate" label="进入本单位时间" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherJobRank" label="聘用岗位等级" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherMajor" label="毕业专业" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherNation" label="民族" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherOffice" label="教研室" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherPolitical" label="政治面貌" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherRank" label="职称" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherRankDate" label="职称评上时间" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherRetired" label="是否退休" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherSituation" label="是否在编" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherTel" label="电话" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherWorkDate" label="参加工作时间" align="center" width="160"></el-table-column>
                    <el-table-column prop="teacherDescription" label="备注" align="center" width="160"></el-table-column>
                    <el-table-column fixed="right" label="操作" width="200">
                        <template slot-scope="scope">
                            <el-button @click="handleEdit(scope.row)" icon="fa fa-pencil"
                                       v-permission="'teacher:base:update'"> 修 改
                            </el-button>
                            <el-button type="danger" @click="handleDelete(scope.row)" icon="fa fa-times-rectangle"
                                       v-permission="'teacher:base:delete'"> 删 除
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-col>
        </el-row>
        <el-drawer
                :title="data.teacherName"
                :visible.sync="drawer"
                direction="rtl"
                :before-close="handleDrawerClose"
                append-to-body
                close-on-press-escape
                size="42%"
        >
            <el-descriptions :column="2" style="margin-left: 18px" size="medium" border>
                <el-descriptions-item label="姓名">{{data.teacherName}}</el-descriptions-item>
                <el-descriptions-item label="生日">{{data.teacherBirthday}}</el-descriptions-item>
                <el-descriptions-item label="教工号">{{data.teacherCollegeId}}</el-descriptions-item>
                <el-descriptions-item label="性别">
                    {{ data.teacherGender }}
                    <i :class=" data.teacherGender === '男' ? 'fa fa-male' : 'fa fa-female'"
                       aria-hidden="true" style="font-size: 16px; margin-left: 10px"></i>
                </el-descriptions-item>
                <el-descriptions-item label="部门">{{ data.teacherDepartment }}</el-descriptions-item>
                <el-descriptions-item label="学历">{{ data.teacherDiplomas }}</el-descriptions-item>
                <el-descriptions-item label="毕业学校">{{ data.teacherGraduateCollege }}</el-descriptions-item>
                <el-descriptions-item label="毕业时间">{{ data.teacherGraduateDate }}</el-descriptions-item>
                <el-descriptions-item label="毕业专业">{{ data.teacherMajor }}</el-descriptions-item>
                <el-descriptions-item label="职称">{{ data.teacherRank }}</el-descriptions-item>
                <el-descriptions-item label="政治面貌">{{ data.teacherPolitical }}</el-descriptions-item>
                <el-descriptions-item label="是否退休">{{ data.teacherRetired }}</el-descriptions-item>
                <el-descriptions-item label="学位">{{ data.teacherDegree }}</el-descriptions-item>
                <el-descriptions-item label="参加工作时间">{{ data.teacherWorkDate }}</el-descriptions-item>
                <el-descriptions-item label="今日本单位时间">{{ data.teacherInDate }}</el-descriptions-item>
                <el-descriptions-item label="职称评上时间">{{ data.teacherRankDate }}</el-descriptions-item>
                <el-descriptions-item label="职称起聘时间">{{ data.teacherHireDate }}</el-descriptions-item>
                <el-descriptions-item label="聘用岗位等级">{{ data.teacherJobRank }}</el-descriptions-item>
                <el-descriptions-item label="入党时间">{{ data.teacherPartyDate }}</el-descriptions-item>

            </el-descriptions>
        </el-drawer>
        <!--      分页区域-->
        <el-row>
            <el-col :span="22">
                <el-pagination v-if="page.total > 10"
                               @size-change="handleSizeChange"
                               @current-change="handleCurrentChange"
                               :current-page="pagination.current"
                               :page-sizes="[9 ,10, 20, 30, 50]"
                               :page-size="pagination.size"
                               layout="total, sizes, prev, pager, next"
                               :total="page.total">
                </el-pagination>
            </el-col>
        </el-row>
        <!--      提示框区域-->
        <el-dialog
                v-dialog-drag
                :title="isAdd ? '新 增 数 据' : '修 改 数 据'"
                :visible.sync="centerDialogVisible"
                width="40%"
                center
                v-permission="'teacher:base:add'"
                @close="resetField"
        >
            <el-form ref="form" :rules="rules" :model="data" label-width="80px">
                <el-form-item label="姓名:" label-width="80px" prop="teacherName">
                    <el-input v-model="data.teacherName" placeholder="姓名"></el-input>
                </el-form-item>
                <el-form-item label="生日:" label-width="80px" prop="teacherBirthday">
                    <el-input v-model="data.teacherBirthday" placeholder="生日"></el-input>
                </el-form-item>
                <el-form-item label="教工号:" label-width="80px" prop="teacherCollegeId">
                    <el-input v-model="data.teacherCollegeId" placeholder="教工号"></el-input>
                </el-form-item>
                <el-form-item label="学位:" label-width="80px" prop="teacherDegree">
                    <el-input v-model="data.teacherDegree" placeholder="学位"></el-input>
                </el-form-item>
                <el-form-item label="部门:" label-width="80px" prop="teacherDepartment">
                    <el-input v-model="data.teacherDepartment" placeholder="部门"></el-input>
                </el-form-item>
                <el-form-item label="备注:" label-width="80px" prop="teacherDescription">
                    <el-input v-model="data.teacherDescription" placeholder="备注"></el-input>
                </el-form-item>
                <el-form-item label="学历:" label-width="80px" prop="teacherDiplomas">
                    <el-input v-model="data.teacherDiplomas" placeholder="学历"></el-input>
                </el-form-item>
                <el-form-item label="性别:" label-width="80px" prop="teacherGender">
                    <el-input v-model="data.teacherGender" placeholder="性别"></el-input>
                </el-form-item>
                <el-form-item label="毕业学校:" label-width="80px" prop="teacherGraduateCollage">
                    <el-input v-model="data.teacherGraduateCollege" placeholder="毕业学校"></el-input>
                </el-form-item>
                <el-form-item label="毕业时间:" label-width="80px" prop="teacherGraduateDate">
                    <el-input v-model="data.teacherGraduateDate" placeholder="毕业时间"></el-input>
                </el-form-item>
                <el-form-item label="职称起聘时间:" label-width="80px" prop="teacherHireDate">
                    <el-input v-model="data.teacherHireDate" placeholder="职称起聘时间"></el-input>
                </el-form-item>
                <el-form-item label="身份证:" label-width="80px" prop="teacherIdentityId">
                    <el-input v-model="data.teacherIdentityId" placeholder="身份证"></el-input>
                </el-form-item>
                <el-form-item label="入党时间:" label-width="80px" prop="teacherInDate">
                    <el-input v-model="data.teacherInDate" placeholder="入党时间"></el-input>
                </el-form-item>
                <el-form-item label="进入本单位时间:" label-width="80px" prop="teacherInDate">
                    <el-input v-model="data.teacherInDate" placeholder="进入本单位时间"></el-input>
                </el-form-item>
                <el-form-item label="聘用岗位等级:" label-width="80px" prop="teacherJobRank">
                    <el-input v-model="data.teacherJobRank" placeholder="聘用岗位等级"></el-input>
                </el-form-item>
                <el-form-item label="毕业专业:" label-width="80px" prop="teacherMajor">
                    <el-input v-model="data.teacherMajor" placeholder="毕业专业"></el-input>
                </el-form-item>

                <el-form-item label="民族:" label-width="80px" prop="teacherNation">
                    <el-input v-model="data.teacherNation" placeholder="民族"></el-input>
                </el-form-item>
                <el-form-item label="教研室:" label-width="80px" prop="teacherOffice">
                    <el-input v-model="data.teacherOffice" placeholder="教研室"></el-input>
                </el-form-item>
                <el-form-item label="政治面貌:" label-width="80px" prop="teacherPolitical">
                    <el-input v-model="data.teacherPolitical" placeholder="政治面貌"></el-input>
                </el-form-item>
                <el-form-item label="职称:" label-width="80px" prop="teacherRank">
                    <el-input v-model="data.teacherRank" placeholder="职称"></el-input>
                </el-form-item>
                <el-form-item label="职称评上时间:" label-width="80px" prop="teacherRankDate">
                    <el-input v-model="data.teacherRankDate" placeholder="职称评上时间"></el-input>
                </el-form-item>
                <el-form-item label="是否退休:" label-width="80px" prop="teacherRetired">
                    <el-input v-model="data.teacherRetired" placeholder="是否退休"></el-input>
                </el-form-item>
                <el-form-item label="是否在编:" label-width="80px" prop="teacherSituation">
                    <el-input v-model="data.teacherSituation" placeholder="是否在编"></el-input>
                </el-form-item>
                <el-form-item label="电话:" label-width="80px" prop="teacherTel">
                    <el-input v-model="data.teacherTel" placeholder="电话"></el-input>
                </el-form-item>
                <el-form-item label="参加工作时间:" label-width="80px" prop="teacherWorkDate">
                    <el-input v-model="data.teacherWorkDate" placeholder="参加工作时间"></el-input>
                </el-form-item>
            </el-form>

            <span slot="footer" class="dialog-footer">
                <el-button @click="centerDialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="addOrUpdateTeacherBase">确 定</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script>

    import {
        page,
        deleteMultipleTeacherBase,
        addTeacherBase,
        updateTeacherBase,
        deleteTeacherBase,
        exportExcel
    } from "../../../api/modules/teacher/base"
    import {form, recommendTeacher} from "../../../api/modules/dictionary";
    import fileDownload from "../../../utils/fileDownload";


    export default {
        name: 'TeacherBase',

        data() {
            return {
                visible:false,
                keyword: {
                    id: 0,
                    teacherBirthday: '',
                    teacherCollegeId: '',
                    teacherDegree: '',
                    teacherDepartment: '',
                    teacherDescription: '',
                    teacherDiplomas: '',
                    teacherGender: '',
                    teacherGraduateCollege: '',
                    teacherGraduateDate: '',
                    teacherHireDate: '',
                    teacherIdentityId: '',
                    teacherPartyDate: '',
                    teacherInDate: '',
                    teacherJobRank: '',
                    teacherMajor: '',
                    teacherName: '',
                    teacherNation: '',
                    teacherOffice: '',
                    teacherPolitical: '',
                    teacherRank: '',
                    teacherRankDate: '',
                    teacherRetired: '',
                    teacherSituation: '',
                    teacherTel: '',
                    teacherWorkDate: '',
                },
                data: {
                    id: 0,
                    teacherBirthday: '',
                    teacherCollegeId: '',
                    teacherDegree: '',
                    teacherDepartment: '',
                    teacherDescription: '',
                    teacherDiplomas: '',
                    teacherGender: '',
                    teacherGraduateCollege: '',
                    teacherGraduateDate: '',
                    teacherHireDate: '',
                    teacherIdentityId: '',
                    teacherPartyDate: '',
                    teacherInDate: '',
                    teacherJobRank: '',
                    teacherMajor: '',
                    teacherName: '',
                    teacherNation: '',
                    teacherOffice: '',
                    teacherPolitical: '',
                    teacherRank: '',
                    teacherRankDate: '',
                    teacherRetired: '',
                    teacherSituation: '',
                    teacherTel: '',
                    teacherWorkDate: '',
                },
                pagination: {
                    current: 1,
                    size: 9
                },
                page: {
                    row: [],
                    total: 0
                },
                multipleSelection: [],
                centerDialogVisible: false,
                // 推荐信息
                recommend: {
                    teacher: [],
                    form: {}
                },
                teacherGenderList:["男","女"],
                teacher_situationList:[
                    "编内","编外","临时"
                ],
                teacher_retired:[
                    "在职","退休"
                ],
                rules: {},
                isAdd: true,
                drawer: false
            };
        },

        methods: {
            dbClick(row){
                this.drawer = true;//打开滑块，并且将数据传输到data里面去
                Object.assign(this.data, row);
            },
            initRecommend() {
                recommendTeacher().then(response => {
                    this.recommend.teacher = response;
                });
                form().then(response => {
                    this.recommend.form = response;
                });
            },
            initTeacherBase() {
                this.visible=false
                page(this.pagination, this.keyword).then(response => {
                    this.page.row = response.row;
                    this.page.total = response.total;
                })
            },
            // 查询
            querySearch(queryString, cb) {
                cb(this.recommend.teacher.filter(item => item.value.indexOf(queryString) !== -1))
            },
            // 搜索
            handleSelect(value) {
                console.log(value);
            },
            // 当前页大小改变
            handleSizeChange(size) {
                this.pagination.size = size;
                this.initTeacherBase();
            },
            // 当前页改变
            handleCurrentChange(current) {
                this.pagination.current = current;
                this.initTeacherBase();
            },
            //添加数据或者修改数据
            addOrUpdateTeacherBase() {
                this.$refs.form.validate(valid => {
                    if (valid) {
                        // 是新增就进行添加
                        if (this.isAdd) {
                            addTeacherBase(this.data).then(() => {
                                // TODO 添加信息 不需要 init
                                this.centerDialogVisible = false;
                                this.initTeacherBase();
                            })
                        } else {
                            updateTeacherBase(this.data).then(() => {
                                // TODO 修改信息 不需要 init
                                this.centerDialogVisible = false;
                                this.initTeacherBase();
                            })
                        }
                    }
                })
            },
            // 修改单个
            handleEdit(row) {
                // 不是添加
                this.isAdd = false;
                Object.assign(this.data, row);
                this.centerDialogVisible = true;
            },
            handleAdd() {
                // 是添加
                this.isAdd = true;
                Object.assign(this.data, {
                    id: 0,
                    teacherBirthday: '',
                    teacherCollegeId: '',
                    teacherDegree: '',
                    teacherDepartment: '',
                    teacherDescription: '',
                    teacherDiplomas: '',
                    teacherGender: '',
                    teacherGraduateCollege: '',
                    teacherGraduateDate: '',
                    teacherHireDate: '',
                    teacherIdentityId: '',
                    teacherPartyDate: '',
                    teacherInDate: '',
                    teacherJobRank: '',
                    teacherMajor: '',
                    teacherName: '',
                    teacherNation: '',
                    teacherOffice: '',
                    teacherPolitical: '',
                    teacherRank: '',
                    teacherRankDate: '',
                    teacherRetired: '',
                    teacherSituation: '',
                    teacherTel: '',
                    teacherWorkDate: '',
                });
                this.centerDialogVisible = true;
            },
            // 删除单个
            handleDelete(row) {
                this.$confirm(`此操作将永久删除 <strong><i> ${row.teacherName} </i></strong> 是否继续?`, '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    dangerouslyUseHTMLString: true,
                    type: 'warning'
                }).then(() => {
                    deleteTeacherBase(row.id).then(() => {
                        // 刷新页面
                        this.initTeacherBase();
                    });
                })

            },
            // 多选框
            handleSelectionChange(row) {
                // 获取 ids
                this.multipleSelection = row.map(item => item.id);
            },
            // 删除多个
            handleMultipleDelete() {
                // 大于 0 才删除
                if (this.multipleSelection.length > 0) {
                    this.$confirm(`此操作将永久删除<strong> 多条信息</strong>是否继续?`, '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        dangerouslyUseHTMLString: true,
                        type: 'warning'
                    }).then(() => {
                        deleteMultipleTeacherBase(this.multipleSelection).then(() => {
                            // 刷新页面
                            this.initTeacherBase();
                        });
                    })
                }
            },
            // 导出 Excel
            exportExcel() {
                exportExcel(this.multipleSelection,this.keyword).then(response => {
                    // 导出excel
                    fileDownload(response);
                })
            },
            resetField() {
                // 清空表单验证
                this.$refs.form.resetFields();
            },
            viewDetails(row) {
                this.drawer = true;//打开滑块，并且将数据传输到data里面去
                Object.assign(this.data, row);
            },
            handleDrawerClose() {
                this.drawer = false;
                this.$refs.form.resetFields();
            },
            refresh() {
                this.initTeacherBase();
                this.initRecommend();
            }
        },


        mounted() {
            this.refresh();
        },
        watch: {
            keyword: {
                deep: true,
                handler() {
                    this.pagination.current = 1
                }
            }
        }
    }
</script>

<style scoped>

</style>